﻿namespace EasyCMS.Common
{
    using System;
    using System.Collections.Generic;
    using Pismire;


    [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "EasyCMS.Common.ISubjects")]
    public interface ISubjects
    {
        /// <summary>
        /// 当前操作的数据供应源名称
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        string DataProviderName { get; }

        /// <summary>
        /// 当前操作的数据供应源参数
        /// </summary>
        [System.Runtime.Serialization.DataMember()]
        string DataProviderArgs { get; }

        /// <summary>
        /// 初始化设置，使用前必须执行
        /// </summary>
        /// <param name="dataProviderName"></param>
        /// <param name="dataProviderArgs"></param>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/Setup", ReplyAction = "http://tempuri.org/ISubjects/SetupResponse")]
        void Setup(string dataProviderName, string dataProviderArgs);

        /// <summary>
        /// 根据ID获取内容主题数据
        /// </summary>
        /// <param name="categoryID"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/GetByID", ReplyAction = "http://tempuri.org/ISubjects/GetByIDResponse")]
        EasyCMS.Common.DataComponents.Subject GetByID(int id);

        /// <summary>
        /// 根据CodeName获取内容主题数据
        /// </summary>
        /// <param name="categoryID"></param>
        /// <param name="codeName"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/GetByCodeName", ReplyAction = "http://tempuri.org/ISubjects/GetByCodeNameResponse")]
        EasyCMS.Common.DataComponents.Subject GetByCodeName(string codeName);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/GetList", ReplyAction = "http://tempuri.org/ISubjects/GetListResponse")]
        List<EasyCMS.Common.DataComponents.Subject> GetList(EasyCMS.Common.Querys.Subject query);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/GetListFull", ReplyAction = "http://tempuri.org/ISubjects/GetListFullResponse")]
        List<EasyCMS.Common.DataComponents.Subject> GetList(EasyCMS.Common.Querys.Subject query, out int recordCount);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/Add", ReplyAction = "http://tempuri.org/ISubjects/AddResponse")]
        ExcuteState Add(ref EasyCMS.Common.DataComponents.Subject subject);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/Update", ReplyAction = "http://tempuri.org/ISubjects/UpdateResponse")]
        ExcuteState Update(ref EasyCMS.Common.DataComponents.Subject subject);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="categoryID"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/Delete", ReplyAction = "http://tempuri.org/ISubjects/DeleteResponse")]
        ExcuteState Delete(int id);

        /// <summary>
        /// 创建一个新的内容数据分区表
        /// </summary>
        /// <param name="SubjectMark"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ISubjects/CreateSubjectTable", ReplyAction = "http://tempuri.org/ISubjects/CreateSubjectTableResponse")]
        ExcuteState CreateSubjectTable(string subjectMark);
    }
}
